Open
Conversation
oinoom
approved these changes
Jun 28, 2023
463d42d to
8be4a16
Compare
5yler
commented
Jul 4, 2023
Comment on lines
+421
to
+427
| # Step 2: Add random time offset to "Date" column | ||
| if "Date" in df.columns: | ||
| df["Date"] = pd.to_datetime(df["Date"]) | ||
| random_offset = pd.tseries.offsets.DateOffset( | ||
| years=np.random.randint(-1000, 1000) | ||
| ) | ||
| df["Date"] += random_offset |
Contributor
Author
There was a problem hiding this comment.
This should be applied to all the dataframes equally so there is still time correspondence
There was a problem hiding this comment.
all reflections get shifted by a random year offset?
oinoom
reviewed
Jul 5, 2023
| # and apply a random linear transformation to numerical columns | ||
| # and replace non-empty strings with a random word | ||
| for col in df.columns: | ||
| if df[col].dtype == "object": |
There was a problem hiding this comment.
object means string? is there any way to narrow this down further?
oinoom
reviewed
Jul 5, 2023
| df[col] = df[col].apply(lambda x: random_word() if x else x) | ||
| elif df[col].dtype in ["int64", "float64"]: | ||
| k = random.uniform(0.5, 10) * random.choice([-1, 1]) | ||
| df[col] = df[col] * k |
There was a problem hiding this comment.
if it's a rating type, won't this be obvious given our current fixed range? what is this protecting from?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.